package uk.co.q3c.deplan.client.ui.component;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 *Simplifies the use of GWT FlowPanel and replaces {@link HorizontalPanel} and {@link VerticalPanel}
 * 
 * 
 * <b>Acknowledgement</b><br>
 * Thanks to Sudhir Jonathan http://blog.sudhirj.com/2009/05/vertical-and-horizontal-flow-panels-in.html
 * 
 * 
 */
public abstract class CustomFlowPanel extends FlowPanel {
	protected abstract String getFlowStyle();

	@Override
	public void add(Widget w) {
		w.getElement().getStyle().setProperty("display", getFlowStyle());
		super.add(w);
	}

}
